#pragma once
#include"Common.hpp"

class PageCache
{
public:
    static PageCache*GetInstance() 
    {
        return &_sInstan;
    }
    //获取一个k页的span
    Span* NewSpan(size_t k);
private:
    PageCache(){}
    PageCache(const PageCache&)=delete;
    SpanList _spanLists[NPAGES];
    //不可以使用桶锁，如果该页没有足够的span，需要去到其它页申请
    std::mutex _pageMtx; 
    //单例
    static PageCache _sInstan;
};

